package com.webbei.Backstage.action;

import java.io.File;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.webbei.util.Arithmetic;


public class FileJson extends ActionSupport {
	private String fileName;
	private String message;
	
	public String execute(){
		String realPath=ServletActionContext.getServletContext().getRealPath("/");
		String path=Arithmetic.getDesString(fileName);
		String fileRealPath = realPath+path;
		System.out.println("fileRealPath:"+fileRealPath);
		File file=new File(fileRealPath);
		if(!file.exists()){
			setMessage("文件不存在！");
		}else{
			message="success";
		}
		return "success";
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getMessage() {
		return message;
	}

}
